package com.imooc.luckymoney;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


/**
 * Created by Admin on 2020/6/28
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    private LimitConfig limitConfig;

    //    @GetMapping({"/say", "/hi"})
    // SpringBoot V1.0 写法@RequestMapping(value= "/hello",method=RequestMethod.GET)
    @PostMapping("/say")
    public String say(@RequestParam(value="id", required=false, defaultValue="0") Integer id) {
//    public String say(@RequestParam("id") Integer id) {

//        return "说明: " + limitConfig.getDescription();
        return String.format("id: %d", id);
//        return "index";
    }

}
